package com.woniuxy02;

import java.text.ParseException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;

/**
 * @author 作者
 * @create 2025-06-05 10:50
 */
public class Test06 {
    public static void main(String[] args) throws ParseException {
        //new SimpleDateFormat("YYYY-MM-dd")
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);
        System.out.println(now.format(dtf));
        System.out.println(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
    }


}
